<!DOCTYPE html>
<html lang="en">
<head>
    <title>京伦内容管理系统</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/bootstrap/css/bootstrap.min.css" />
    <load href="__PUBLIC__/bootstrap/js/jquery.min.js" />
    <load href="__PUBLIC__/bootstrap/js/bootstrap.min.js" />
    <load href="__PUBLIC__/js/jquery.js" />
    <load href="__PUBLIC__/jquery-ui/jquery-ui.css" />
    <load href="__PUBLIC__/jquery-ui/jquery-ui.js" />
    <style>
        #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
        #sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em;  height: 30px; width: 300px; }
        #sortable li span { position: absolute; margin-left: -1.3em; }
    </style>
</head>
<body>

<!-- header -->
<include file="Public:header" />



<div class="row">
    <!-- left -->

    <include file="Content:left" />

    <div class="col-md-8" style="padding-top: 70px;">
        
            <ol class="breadcrumb">
                <li><a href="#">Home</a></li>
                <li><a href="#">Content</a></li>
                <li class="active">{$pagetitle}</li>
            </ol>
        

        <!-- Content -->
        <div class="tab-wrap">
            <!--<ul class="nav nav-tabs" role="tablist" id="myTab">-->
                <!--<li class="active"><a href="#home" role="tab" data-toggle="tab">基础</a></li>-->
                <!--<li><a href="#profile" role="tab" data-toggle="tab">设计</a></li>-->
            <!--</ul>-->
            <ul id="myTab" class="nav nav-tabs">
                <li class="active"><a href="#home" role="tab" data-toggle="tab">基础</a></li>
                <li><a href="#profile" role="tab" data-toggle="tab">设计</a></li>
            </ul>
<form id="form" action="{:U('Model/update')}" method="post" class="form-horizontal doc-modal-form">
            <div id="myTabContent" class="tab-content">
                <!-- 表单 -->
                
                    <!-- 基础 -->
                    <div class="tab-pane fade in active" id="home">
                        <div class="form-group" style="padding-top: 20px;">
                            <label class="col-sm-2 control-label">模型标识</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="name" value="{$info.name}">
                            </div><span class="help-block">（请输入文档模型标识）</span>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">模型名称</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="title" value="{$info.title}">
                            </div><span class="help-block">（请输入模型的名称）</span>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">模型类型</label>
                            <div class="col-sm-4">
                                <select name="extend" class="form-control">
                                    <option value="0" <if condition="$info['extend'] eq 0">selected</if>>独立模型</option>
                                    <option value="1" <if condition="$info['extend'] eq 1">selected</if>>文档模型</option>
                                </select>
                            </div>
                         	<span class="help-block">（目前支持独立模型和文档模型）</span>
                        </div>
                    </div>

                    <div class="tab-pane fade" id="profile">
                        <div class="form-group" style="padding-top: 20px;">
                            <label class="col-sm-2 control-label">字段管理</label>
                            <div class="col-sm-4">
                                <div class="">
                                <table class="table table-hover table-striped">
                                    <tr>
                                        <td>
                                            <a href="{:U('Attribute/add?model_id='.$info['id'])}" target="_balnk">新增</a>
                                            <a href="{:U('Attribute/index?model_id='.$info['id'])}" target="_balnk">管理</a>
                                        </td>
                                    </tr>
                                    <foreach name="fields" item="field" key="k">
                                    <tr>
                                        <td>{$field['title']} [{$field['name']}]</td>
                                    </tr>
                                    </foreach>
                                </table>
                                </div>
                            </div>
                            <span class="help-block">（只有新增了字段，该表才会真正建立）</span>
                        </div>

                        <script>
                            $(function() {
                                $( "#sortable" ).sortable();
                                $( "#sortable" ).disableSelection();
                            });
                        </script>


                        <div class="form-group">
                            <label class="col-sm-2 control-label">列表定义</label>
                            <div class="col-sm-4">
                                <textarea name="list_grid" class="form-control" rows="3">{$info.list_grid}</textarea>
                            </div>
                            <span class="help-block">（默认列表模板的展示规则）</span>
                        </div>

                    </div>
 </div>
                    <!-- 按钮 -->
                    <div class="form-group" >
                    <label class="col-sm-2 control-label"></label>
                    <div class="col-sm-4">
                              

                           
                        <label class="item-label"></label>
                        <div class="controls edit_sort_btn">
                            <input type="hidden" name="id" value="{$info['id']}"/>
                            <button class="btn submit-btn ajax-post no-refresh btn-primary" type="submit" target-form="form-horizontal">确 定</button>
                            <button class="btn btn-return btn btn-default" onClick="javascript:history.back(-1);return false;">返 回</button>
                        </div>
                         </div>
                    </div>
                </form>
           
        </div>


    </div>
</div>





</body>
</html>
